<template>
    <div class="section-wrap">
        <!-- 头部 -->
         <div class="headerBox">
        <div class="header">
            <x-icon type="ios-arrow-left" size="" class="icon-white" @click="goBack"></x-icon>选择分工
        </div>
        </div>
        <div class="form-section" style="margin-top: 40px;">
            <div class="details">
                <div class="details_top">
                    <p>已选择：2条</p>
                    <span class="all_span">共计：100条</span>
                </div>

                <ul class="details_list">
                  <!--<li v-for="(item,index) in detailData">
                    <div>{{item.quantizeName.substring(item.quantizeName.lastIndexOf("-")+1,item.quantizeName.length)}}<span>（已选{{count}}条）</span>
                      <x-icon type="ios-arrow-up" size="22" class="icon-up"></x-icon><i class="all_check" v-bind:class="{'active':index==curIndex}" @click="selectAllBtn(index)">全部</i></div>
                    <ul class="list_3" >
                      <li v-for="name in item.children"><span class="check" v-bind:class="{'active':index==curIndex}"></span>{{name.quantizeName.substring(name.quantizeName.lastIndexOf("-")+1,name.quantizeName.length)}}</li>
                    </ul>
                  </li>-->
                    <li>
                        <div>综合部分<span>（已选1条）</span><x-icon type="ios-arrow-up" size="22" class="icon-up"></x-icon><i class="all_check">全部</i></div>
                        <ul class="list_3">
                            <li><span class="check active"></span>安全质量管理投入</li>
                            <li><span class="check"></span>风险管理</li>
                            <li><span class="check"></span>施工方案管理</li>
                            <li><span class="check"></span>作业过程管理</li>
                            <li><span class="check"></span>安全管理纠偏</li>
                            <li><span class="check"></span>安全培训管理</li>
                            <li><span class="check"></span>质量验收管理</li>
                            <li><span class="check"></span>作业层班组管理</li>
                            <li><span class="check"></span>分包安全管理</li>
                        </ul>
                    </li>
                    <li>
                        <div>安全部分<x-icon type="ios-arrow-up" size="22" class="icon-up"></x-icon><i class="all_check">全部</i></div>
                        <ul class="list_2">
                            <li>
                                <div>通用部分<x-icon type="ios-arrow-up" size="22" class="icon-up"></x-icon><i class="all_check">全部</i></div>
                                <ul class="list_3">
                                    <li><span class="check"></span>临时用电</li>
                                    <li><span class="check"></span>消防</li>
                                    <li><span class="check"></span>高处作业</li>
                                </ul>
                            </li>
                            <li>
                                <div>线路部分<x-icon type="ios-arrow-up" size="22" class="icon-up"></x-icon><i class="all_check">全部</i></div>
                                <ul class="list_3">
                                    <li><span class="check"></span>架空线路工程土石方施工</li>
                                </ul>
                            </li>
                            <li>
                                <div>质量部分<x-icon type="ios-arrow-up" size="22" class="icon-up"></x-icon><i class="all_check">全部</i></div>
                                <ul class="list_3">
                                    <li><span class="check"></span>通用部分</li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>

            <div class="btns_div">
                <a class="saveBtn">保 存</a>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data () {
            return {
              curIndex:null,
              isActive:false,
                count:0,
                isDisabled: true, // 是否禁止输入
                detailData: [{
                  id: "",
                  quantizeName: "1-1",
                  panrentId: "",
                  tier: "",
                  status: "",
                  createUser: "",
                  createDate: "",
                  departID: "",
                  claOrder: "",
                  year: "",
                  allPanrentId: "",
                  children: [{
                    id: "",
                    quantizeName: "12-12",
                    panrentId: "",
                  },{
                    id: "",
                    quantizeName: "123-123",
                    panrentId: "",
                  }],
                },{
                  id: "",
                  quantizeName: "2-2",
                  panrentId: "",
                  tier: "",
                  status: "",
                  createUser: "",
                  createDate: "",
                  departID: "",
                  claOrder: "",
                  year: "",
                  allPanrentId: "",
                  children: [{
                    id: "",
                    quantizeName: "22-22",
                    panrentId: "",
                  }],
                }],
                member1:'张丽',
                member2:'周丽丽',
            }
        },
        components: {
        },
        created () {
           this.getDivisionList()
        },
        methods: {
            goBack(){
                this.$router.go(-1)
            },
          getDivisionList(){//
            this.$axiosAjax.getDivisionList({parentId:"0"}).then((res) => {
              if(res.data.success==true){
                this.detailData=res.data.result.items
              }
            }).catch(
              (err)=>{

              }
            )
          },
          selectAllBtn(p){
              if(this.curIndex == p){
                this.curIndex =null
              }else{
                this.curIndex = p
              }
          }
        }
    }
</script>
<style lang="less" scoped>
    .details{
        .details_top{
            border-bottom: 10px solid #ebeef2;
            height: 55px;
            line-height: 45px;
            padding-right: 20px;
            padding-left: 20px;
            background: #fff;
            p{
                float: left;
                color: #469b7a;
                font-size: 14px;
                font-weight: bold;
            }
            .all_span{
                font-size: 14px;
                color: #333;
                float: right;
            }
        }
        .details_list{
            .vux-x-icon{
                fill:#999;
                float: right;
                margin-top: 16px;
            }
            .all_check{
                float: right;
                font-size: 14px;
                padding-left: 20px;
            }
            .check,.all_check{
                background-image: url("/static/images/checkbox.png");
                background-repeat: no-repeat;
                background-size: 15px 15px;
                background-position: left center;
            }
            .check{
                width: 15px;
                height: 54px;
                display: block;
                float: left;
                margin-left: 2em;
                margin-right: 5px;
            }
            .check.active,.all_check.active{
                background-image: url("/static/images/checked.png");
            }
            li{
                >div {
                    height: 54px;
                    line-height: 54px;
                    padding-right: 20px;
                }
            }
            >li{
                padding-left: 20px;
                border-bottom: 5px solid #ebeef2;
                >div{
                    font-weight: bold;
                    font-size: 16px;
                }
                .list_2{
                    li{
                        border-top: 1px solid #ebeef2;
                        >div{
                            font-weight: bold;
                            font-size: 14px;
                        }
                    }
                }
                .list_3{
                    li{
                        font-size: 14px;
                        height: 55px;
                        line-height: 54px;
                        border-top: 1px solid #ebeef2;
                        padding-right: 20px;
                        >p{
                            display: block;
                            height: 15px;
                            width: 15px;
                            float: right;
                            font-size: 12px;
                            color: #fff;
                            border-radius: 50%;
                            background: #469b7a;
                            margin-top: 19px;
                            line-height: 17px;
                            text-align: center;
                            text-indent: 0;
                        }
                    }
                }
            }
        }
    }
    .btns_div{
        background: #ebeef2;
        padding: 30px 20px 55px;
        justify-content: center;
        display: flex;
        a{
            height: 40px;
            border-radius: 20px;
            display: inline-block;
            width: 200px;
            text-align: center;
            line-height: 40px;
            color: #fff;
        }
        .saveBtn{
            background: #469b7a;
        }
        .submitBtn{
            background: #15bd84;
        }
    }
</style>
